home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #1 / Amiga Plus CD - 2000 - No. 1.iso / Tools / Text / Edit / GoldED-Demo / installdata / golded / developer / scanner / examples / a68k / a68k.c
Encoding:
C/C++ Source or Header  |  1999-12-03  |  824 b   |  35 lines

  1. /* -----------------------------------------------------------------------------
  2.  
  3.   Scan handler looking for assembler labes.
  4.   
  5.   Scan handlers are plain functions (loadSeg()'ed): no standard C startup
  6.   code and no library calls permitted. We have to put string constants into
  7.   the code segment (DICE compiler: option -ms1).
  8.  
  9.   DICE:
  10.   
  11.   dcc a68k.c -// -l0 -md -mRR -o golded:etc/scanner/a68k
  12.  
  13.   ------------------------------------------------------------------------------
  14. */
  15.  
  16. #include <exec/types.h>
  17.  
  18. ULONG
  19. ScanHandlerA68k(__D0 ULONG len, __A0 char **text, __A1 ULONG *line)
  20. {
  21.     const char *version = "$VER: A68k 1.1 (" __COMMODORE_DATE__ ")";
  22.  
  23.     while (len && (**text == 32)) {
  24.  
  25.         ++*text;
  26.         --len;
  27.     }
  28.  
  29.     if ((len > 1) && (**text == '_'))
  30.         return(len);
  31.     else
  32.         return(FALSE);
  33. }
  34.  
  35.